package cn.jetbrain.netbeans.pdfviewer;

import org.openide.windows.Mode;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;

public class View extends TopComponent {
    protected boolean force = false;
    protected  PDFViewer view;

    public void setPDFViewer(PDFViewer v) {
    }

    public PDFViewer getPDFViewer() {
        return view;
    }

    @Override
    public void open() {
        if (!isOpened()) {
            Mode m = WindowManager.getDefault().findMode("explorer");
            if (m != null) {
                m.dockInto(this);
            }
        }
        super.open();
    }

    void forceClose() {
        force = true;
        this.close();
    }
}
